package com.file.sql.service.impl;

import com.file.sql.service.SQLService;
import com.file.xml.pojo.Xml;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.stereotype.Service;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;

@Service
public class SQLServiceImpl implements SQLService {

    @Override
    public void ListSQL() throws IOException {
        //读取Resource目录下的XML文件
        Resource resource = new ClassPathResource("test.sql");
        //利用输入流获取XML文件内容
        BufferedReader br = new BufferedReader(new InputStreamReader(resource.getInputStream(), StandardCharsets.UTF_8));
        StringBuffer buffer = new StringBuffer();
//        String line = "";
//        int i = 0;
//        while ((line = br.readLine()) != null) {
//            i++;
//            if (i > 100){
//                break;
//            }
//            buffer.append(line);
//        }
        br.close();
    }


}
